﻿using System;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int rev = Reverse(n);
        Console.WriteLine(rev);
    }

    private static int Reverse(int n)
    {
        int num = n;
        int r = 0;
        int rev = 0;
        while (num > 0)
        {
            r = num % 10;
            rev = rev * 10 + r;
            num = num / 10;
        }
        return rev;
    }
}